<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%--<script type="text/javascript" src="resource/js/jquery-3.2.1.js"></script>
<link href="resource/css/bootstrap.css" rel="stylesheet">
<link href="resource/css/index.css" rel="stylesheet">--%>

</head>
<body>
	<div>
	<nav aria-label="Page navigation example">
		<ul class="pagination">
			<c:if test="${page.total==0}">
				<i>暂无数据</i>
			</c:if>
			<c:if test="${page.total!=0}">
				<li class="page-item">
					<a class="page-link" href="javascript:goPage(1)"aria-label="Previous">
						<span aria-hidden="true">首页</span>
					</a>
				</li>
			</c:if>
			<c:if test="${page.total!=0}">
				<li class="page-item">
					<a class="page-link" href="javascript:goPage(${page.prePage==0?1:page.prePage })"aria-label="Previous">
					<span aria-hidden="true">上一页</span>
					</a>
				</li>
			</c:if>
			<c:forEach items="${page.navigatepageNums}" var="n">
				<li class="page-item ${n==page.pageNum?"active":""}"><a
					class="page-link" href="javascript:goPage(${n})">${n}</a></li>
			</c:forEach>
			<c:if test="${page.total!=0}">
				<li class="page-item"><a class="page-link"
					href="javascript:goPage(${page.nextPage ==0?page.pages:page.nextPage})"
					aria-label="Next"> <span aria-hidden="true">下一页</span>
				</a></li>
			</c:if>
			<c:if test="${page.total!=0}">
				<li class="page-item"><a class="page-link"
										 href="javascript:goPage(${page.pages})"
										 aria-label="Next"> <span aria-hidden="true">尾页</span>
				</a></li>
			</c:if>
			<li class="page-item">
				<span aria-hidden="true" class="page-link" style="color: #007bff">合计：${page.pageNum}/${page.pages }页   总条数:${page.total}</span>
			</li>
			<c:if test="${page.total!=0}">


				<li class="page-item text-primary">共${page.pages }页 ，转<input id="page" class="col-2"  type="text" onchange="goPage($(this).val())">页</li>

			</c:if>

		</ul>
	</nav>

</div>
	<script type="text/javascript">
	  function goPage(pageNum){
		  $("form").append("<input type='hidden' name='pageNum' value='"+pageNum+"'>");
		  $("form").submit();
	  }
	</script>
</body>
</html>




